#!/bin/sh

if [ -n "$1" ]
then
	echo "sh get params $1"
	ifconfig $1 up
	if [ $? -eq 0 ]
	then
		echo "sh net $1 up success"
		sleep 1
		udhcpc -i $1
		if [ $? -eq 0 ]
		then
			echo "sh net $1 dhcp init success"
		else
			"sh net $1 dhcp init failed"
			exit 1
		fi
	else
		echo "sh net $1 up failed"
		exit 1
	fi
else
    echo "sh get null params"
	exit 1
fi
